package com.prbqb.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.prbqb.mapper.BlogMapper;
import com.prbqb.pojo.Blog;
import com.prbqb.service.BlogService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements BlogService {

    @Override
    public Page listBlog(Integer currentPage , Integer pageSize) {

        Page page = new Page();
        page.setCurrent(currentPage);
        page.setSize(pageSize);

        List<Blog> blogs = baseMapper.listBlog(page);
        page.setRecords(blogs);

        return page;
    }
}
